using UnityEngine;
using System.Collections;

public class Tesr : MonoBehaviour {
	

	// Use this for initialization
	void Start () {
	}
	
	// Update is called once per frame
	void Update () {
        //gameObject.transform.localPosition -= new Vector3(3,0,0);

        Vector3 pos = Camera.mainCamera.WorldToScreenPoint(transform.position);
        Debug.Log(pos.x + " " + pos.y + " " + pos.z);
        if (pos.x < 0 || pos.x > Screen.width)
        {
            gameObject.SetActive(false);
        }
        else
        {
            gameObject.SetActive(true);
        }
	}
}
